.TH std::experimental::filesystem::path::begin,std::experimental::filesystem::path::end 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::experimental::filesystem::path::begin,std::experimental::filesystem::path::end \- std::experimental::filesystem::path::begin,std::experimental::filesystem::path::end

.SH Synopsis
   iterator begin() const; \fB(1)\fP (filesystem TS)
   iterator end() const;   \fB(2)\fP (filesystem TS)

   1) Returns an iterator to the first element of the path. If the path is empty, the
   returned iterator is equal to end().
   2) Returns an iterator one past the last element of the path. Dereferencing this
   iterator is undefined behavior.

   The sequence denoted by this pair of iterators consists of the following:

   1) root-name (if any).
   2) root-directory (if any).
   3) Sequence of file-names, omitting any directory separators.
   4) If there is a directory separator after the last file-name in the path, the last
   element before the end iterator is a fictitious dot file name.

.SH Parameters

   \fI(none)\fP

.SH Return value

   1) Iterator to the first element of the path.
   2) Iterator one past the end of the path.

.SH Exceptions

   May throw implementation-defined exceptions.

.SH Example


// Run this code

 #include <experimental/filesystem>
 #include <iostream>
 namespace fs = std::experimental::filesystem;

 int main()
 {
     fs::path p = "C:\\\\users\\\\abcdef\\\\AppData\\\\Local\\\\Temp\\\\";
     std::cout << "Examining the path " << p << " through iterators gives\\n";
     for (auto& e : p)
         std::cout << e << '\\n';
 }

.SH Output:

 Examining the path "C:\\users\\abcdef\\AppData\\Local\\Temp\\" through iterators gives
 "C:"
 "/"
 "users"
 "abcdef"
 "AppData"
 "Local"
 "Temp"
 "."

.SH Category:
     * Noindexed pages
